Python Program to remove elements that are less than K difference away in a list
Given a list, perform removal of those elements whose difference is less than K from its previous element....
read more
Python | Flatten and Reverse Sort Matrix
The flattening of list of list has been discussed many times, but sometimes, in addition to flattening, it is also required to get the string in reverse sorted manner. Let’s discuss certain ways in which this can be done....
read more
Python | Merging duplicates to list of list
Sometimes, we need to perform the conventional task of grouping some like elements into a separate list and thus forming a list of lists. This can also help in counting and also get the sorted order of elements. Let’s discuss certain ways in which this can be done....
read more
Python | Sum two unequal length lists in cyclic manner
Given two unequal-length lists, the task is to add elements of two list such that when elements of the smaller list are over, add elements in a circular manner till all element of the larger list is iterated. Let’s discuss different ways we can do this task....
read more
Python – Sort by Uppercase Frequency
Given a list of strings, perform sorting by frequency of uppercase characters....
read more
Python – Specific Range Addition in List
Sometimes, while working with Python, we need to perform an edition in the Python list. And sometimes we need to perform this to a specific index range in it. This kind of application can have applications in many domains. Let us discuss certain ways in which this task can be performed....
read more
Python | Extract Score list of String
Sometimes, while programming we can have a problem in which we dedicate to each character of alphabets a particular score and then according to string, extract only those score for further computations. This can have application in gaming domain. Let’s discuss certain ways in which this task can be performed....
read more
Python | Selective Merge list every Nth position
Sometimes, while working with Python list, we can come into a problem in which we need to perform merging in list. A simple merge of list is easier to perform. But sometimes, we need to handle variations in merge. One such can be merge one list with other at every Nth element. This particular problem can be faced in day-day programming and competitive programming. Let’s discuss certain way in which this task can be performed....
read more
Python | Find frequency of given character at every position in list of lists
Given a list of lists, the task is to find the frequency of a character at every position of sub-list in list of lists....
read more
Python – Filter rows with Elements as Multiple of K
Given a Matrix, extract rows with elements multiple of K....
read more
Python – Index Value Summation List
To access the elements of lists, there are various methods. But sometimes we may require to access the element along with the index on which it is found and compute its summation, and for that, we may need to employ different strategies. This article discusses some of those strategies....
read more
Python | Extract Combination Mapping in two lists
Sometimes, while working with Python lists, we can have a problem in which we have two lists and require to find the all possible mappings possible in all combinations. This can have possible application in mathematical problems. Let’s discuss certain way in which this problem can be solved. Method : Using zip() + product() With these functions this problem can be solved and would require two steps to perform it. In the 1st step, we find all the combinations of elements using product() and as a part of 2nd step, we perform the possible pairing with the result of step 1 using zip() and output the desired result....
read more